package card;

/**
 * Class card contain basic information of a card
 * 
 * 
 * @version 2.0.0
 */
public class Card {
	/**
	 * suit could be (s)hape, (h)eart, (c)lub, (d)iamond or (g)host value could
	 * be (A), (2), (3), (4), (5), (6), (7), (8), (9), (X), (J), (Q), (K),
	 * (R)ed, (B)lack
	 */
	private char suit;
	private char value;
	private final char NOVALUE = '\0';

	// Methods
	/**
	 * constructor
	 */
	public Card() {
		suit = NOVALUE;
		value = NOVALUE;
	}

	/**
	 * constructor with parameter
	 * 
	 * @param s
	 * @param v
	 */
	public Card(char s, char v) {
		suit = s;
		value = v;
	}

	/**
	 * copy constructor
	 * 
	 * @param c
	 */
	public Card(Card c) {
		suit = c.getSuit();
		value = c.getValue();
	}

	/**
	 * set s to the class
	 * 
	 * @param s
	 */
	public void setSuit(char s) {
		suit = s;
	}

	/**
	 * set y to the class
	 * 
	 * @param v
	 */
	public void setValue(char v) {
		value = v;
	}

	/**
	 * @return suit
	 */
	public char getSuit() {
		return suit;
	}

	/**
	 * @return value
	 */
	public char getValue() {
		return value;
	}

	/**
	 * Compare the suit and value of two cards
	 * 
	 * @param card
	 *            The Card object to compare.
	 * @return If suits for both cards are the same and values for both cards
	 *         are the same, return true. Any case else return false.
	 * 
	 *         compare if two cards are equal
	 */
	public boolean compare(Card card) {
		return (card.getSuit() == getSuit() && card.getValue() == getValue());
	}

	/**
	 * Set the suit and value of the Card object to null.
	 */
	public void clear() {
		suit = NOVALUE;
		value = NOVALUE;
	}
}
